import java.util.Scanner;

public class StudentData {
    private static Student []stuData;
    public static int num;

    public static void set(int x){
        Scanner sc=new Scanner(System.in);
        stuData=new Student[10];
        for (int i = 0; i < x; i++) {
            System.out.println("输入学号：");
            String a=sc.nextLine();
            System.out.println("输入姓名:");
            String b=sc.nextLine();
            System.out.println("输入性别:");
            String c=sc.nextLine();
            System.out.println("输入年龄");
            int d=sc.nextInt();
            sc.nextLine();
            stuData[i]=new Student(a,b,c,d);
        }
        num=x;
    }

    public static Student[] getStuData(){
        return StudentData.stuData;
    }
    public static  Student getStudent(int x){
        if(x<num){
            return stuData[x];
        }else{
            return null;
        }
    }
    public static void stuDataSet(Student []stu1){
        if(stu1==null){
            return;
        }
        stuData=stu1;
    }

    public static void stuSet(Student stu1,int i){
        if(stu1==null){
            return;
        }
        stuData[i]=stu1;
    }
}
